home *** CD-ROM | disk | FTP | other *** search
/ Collection of Internet / Collection of Internet.iso / msdos / lynx / source / doslynx / inc / gridtext.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-10-25  |  4.1 KB  |  121 lines

  1. #ifndef __GRIDTEXT_H
  2. //    Avoid include redundancy
  3. #define __GRIDTEXT_H
  4.  
  5. //    Copyright (c) 1994, University of Kansas, All Rights Reserved
  6. //
  7. //    Include File:    gridtext.h
  8. //    Purpose:    implement WWW gridtext functions.
  9. //    Remarks/Portability/Dependencies/Restrictions:
  10. //        Callable by "C" but works through "C++" objects.
  11. //    Revision History:
  12. //        B.C.        Originally copied from CERN's linemode
  13. //                    browser.
  14. //                1st rewrite to work on dos.
  15. //                2nd rewrite to display with a turbovision
  16. //                    TScroller class in C++.
  17. //                3rd rewrite to optimize memory usage.
  18. //        02-01-94    created
  19. //                4th complete rewrite to fully support a
  20. //                    binary stream design to use minimal
  21. //                    memory, disk storage for data, and
  22. //                    no display or formatting capability.
  23. //        02-25-94    Modifications began to no longer keep
  24. //                    paragraphs, styles, and anchors in
  25. //                    memory but to actually write them
  26. //                    and their pointer values to file.
  27.  
  28. //    Constant defines
  29. #define Uses_TNSCollection
  30.  
  31. //    Required includes
  32. #include"textattr.h"
  33. #include"ttempnam.h"
  34. #include<tv.h>
  35. #include<fstream.h>
  36. #include<dir.h>
  37.  
  38. extern "C"    {
  39. #include"htext.h"
  40. }; // externt "C"
  41.  
  42. //    Class declarations
  43. extern "C"    {
  44.  
  45. //    The _HText "C" structure.
  46. //    Consider the functions declared below public member functions
  47. //    of _HText.
  48. struct _HText    {
  49.     //    The anchor to this HText.
  50.     HTParentAnchor *HTPAp_node_anchor;
  51.     //    The number of views currently looking at this HText.
  52.     unsigned short int usi_Views;
  53.     //    The following are just flags to determine if the HText
  54.     //    has the specified attribute.
  55.     Boolean B_hasParagraph;
  56.     Boolean B_hasStyle;
  57.     //    The stream associated with this HText where all static data
  58.     //    will be written.
  59.     fstream *fsp_image;
  60.     //    The name of the above stream.
  61.     TTempName *TTNp_fspname;
  62.     //    Wether or not the HText is currently being loaded.
  63.     Boolean B_isLoading;
  64.     //    A List of forms.
  65.     HTList *HTLp_forms;
  66.     //    Wether or not in a Form currently.
  67.     Boolean B_inForm;
  68. };
  69.  
  70. //    Create a new HText object.
  71. extern HText *HText_new(HTParentAnchor *HTPAp_anchor);
  72. //    Create a new HText object with redirection, not supported.
  73. extern HText *HText_new2(HTParentAnchor *HTPAp_anchor, HTStream *HTSp_stream);
  74. //    Free up a HText object.
  75. extern void HText_free(HText *HTp_text);
  76. //    Prepare a HText object for appending of data.
  77. extern void HText_beginAppend(HText *HTp_text);
  78. //    End the apppending of data to a HText object.
  79. extern void HText_endAppend(HText *HTp_text);
  80. //    Prepare a HText object for a new paragraph.
  81. #define HText_beginParagraph HText_appendParagraph
  82. extern void HText_appendParagraph(HText *HTp_text);
  83. //    End the appending of a paragraph to a HText object.
  84. extern void HText_endParagraph(HText *HTp_text);
  85. //    Prepare a HText object for a new style.
  86. #define HText_beginStyle HText_setStyle
  87. extern void HText_setStyle(HText *HTp_text, HTStyle *HTSp_style);
  88. //    End the current style of a HText object.
  89. extern void HText_endStyle(HText *HTp_text);
  90. //    Prepare a HText object for a new anchor.
  91. extern void HText_beginAnchor(HText *HTp_text, HTChildAnchor *HTCAp_anchor);
  92. //    End the current anchor of a HText object.
  93. extern void HText_endAnchor(HText *HTp_text);
  94. //    Append a character to a HText object.
  95. extern void HText_appendCharacter(HText *HTp_text, char c_append);
  96. //    Append a image to a HText object.
  97. extern void HText_appendImage(HText *text, HTChildAnchor *anc,
  98.     CONST char *alternative_text, int alignment, BOOL isMap);
  99. //    Append a string to a HText object.
  100. extern void HText_appendText(HText *HTp_text, const char *cp_append);
  101. //    Select an anchor in a HText object.
  102. extern BOOL HText_selectAnchor(HText *HTp_text, HTChildAnchor *HTCAp_anchor);
  103. //    Select a HText object for display NOW.
  104. extern BOOL HText_select(HText *HTp_text);
  105. //    Begin the creation of a Form.
  106. extern void HText_beginForm(HText *HTp_text, const char *cp_action,
  107.     const char *cp_method);
  108. //    End the creation of the last form began.
  109. extern void HText_endForm(HText *HTp_text);
  110. //    If currently in a form or not.
  111. extern BOOL HText_inForm(HText *HTp_text);
  112.  
  113.  
  114. }; // extern "C"
  115.  
  116. //    Global variable declarations
  117.  
  118. //    Macros
  119.  
  120. #endif // __GRIDTEXT_H
  121.